package cn.com.lightech.led_g5g.model;

import android.content.SharedPreferences;

import cn.com.lightech.led_g5g.gloabal.App;

import static android.content.Context.MODE_PRIVATE;

/**
 * Created by PC on 2017/5/20.
 */

public class LocalLedChannelModel {
    /**
     *  key of  led channel
     */
    private  static  final String LED_CHANNEL = "LED_CHANNEL";

    /**
     * 加载通道数
     * @return
     */
    public int getLocalChannel(){
        final SharedPreferences sharedPreferences = App.getInstance().getSharedPreferences(App.getInstance().getPackageName(), MODE_PRIVATE);

        int led_changel = sharedPreferences.getInt(LED_CHANNEL, 0);
        return led_changel;
    }


    /**
     * 保存通道数
     * @return
     */
    public void setLocalChannel(int ledChanel){
        final SharedPreferences sharedPreferences = App.getInstance().getSharedPreferences(App.getInstance().getPackageName(), MODE_PRIVATE);
        SharedPreferences.Editor edit = sharedPreferences.edit();
        edit.putInt(LED_CHANNEL,ledChanel);
        edit.commit();
    }


    
    
    
}
